#include "RestStepBoard.h"

CRestStepBoard::CRestStepBoard()
{
}

CRestStepBoard::~CRestStepBoard()
{
}

bool CRestStepBoard::init()
{
	if (!Node::init())
	{
		return false;
	}
	m_nStep = 99;

	SpriteFrameCache* pCache = SpriteFrameCache::getInstance();
	pCache->addSpriteFramesWithFile("sprites/effects.plist");

	Sprite* pBoard = Sprite::createWithSpriteFrameName("board.png");
	this->addChild(pBoard);

	pNum = Label::createWithSystemFont("99", "Aria", 24);
	pNum->setPositionY(-pBoard->getContentSize().height / 8);
	this->addChild(pNum);

	Sprite* pText = Sprite::createWithSpriteFrameName("rest_step.png");
	pText->setPositionY(-pBoard->getContentSize().height / 1.5);
	this->addChild(pText);

	return true;
}

void CRestStepBoard::updateStep(int nStep)
{
	m_nStep = nStep;
	pNum->setString(to_string(nStep));
}

